define(function(require) {
	require("jquery");
	var appInfo = require('app/AppInfo');
	var c = require('app/utils/CommonUtils');
	var hc = require('app/utils/HttpClientUtils');
	var tip = require('app/utils/TipUtils');
	var dbu = require('app/utils/DBUtils');
	var APIUtils = require('app/utils/APIUtils');
	var win = window;
	var action = {};
	var navbars = [{
		title : "验证码登录",
		titleSelected : '验证码登录',
		bg: '#FFFFFF',
		bgSelected: '#FFFFFF',
	}, {
		title : "密码登录",
		titleSelected : '密码登录',
		bg: '#FFFFFF',
		bgSelected: '#FFFFFF',
	}];
	action.setHeaderH = function(h) {
		win.header_h = h;
	}
	action.openLoginByVCFrm = function() {
		var name = "LoginByVCFrm";
		api.openFrame({
			name : name,
			url : './' + name + '.html',
			bounces : false,
			rect : {
				x : 0,
				y : win.header_h + 1,
				w : APIUtils.winW(),
				h : APIUtils.winH() - win.header_h - 1
			},
			reload : false
		});
	}
	action.openLoginByPSDFrm = function(){
		var name = "LoginByPSDFrm";
		api.openFrame({
			name : name,
			url : './' + name + '.html',
			bounces : false,
			rect : {
				x : 0,
				y : win.header_h + 1,
				w : APIUtils.winW(),
				h : APIUtils.winH() - win.header_h - 1
			},
			reload : false
		});
	}
	action.openNavbar = function() {
		var h = win.header_h;
		var NVNavigationBar = api.require('NVNavigationBar');
		NVNavigationBar.open({
			rect : {
				x : 0,
				y : 0,
				w : api.frameWidth,
				h : h
			},
			styles : {
				orientation: 'horizontal',
				bg: '#ffffff',
				bgAlpha: 1,
				font: {
					size: 16,
					sizeSelected: 16,
					color: '#9e9e9e',
					colorSelected: '#ff6a32',
					alpha: 1
				},
				itemSize : {
					w : api.frameWidth / 2,
					h : h
				}
			},
			items : navbars,
			selectedIndex : 0,
			fixedOn : api.frameName,
			id : 'navigationBar'
		}, function(ret, err) {
			if (ret.eventType == "click") {
				if (ret.index == 0) {
					action.openLoginByVCFrm();
				} else {
					action.openLoginByPSDFrm();
				}
			} else {
				action.openLoginByVCFrm();
			}
		});

	}

	return action;
});
